<template>
	<view>
		<!-- :hot-citys="hotCitys" -->
		<view class="flex" style="width:682rpx;height: 62rpx;background: #F2F2F2;border-radius: 42rpx;padding:10rpx 14rpx;margin:4rpx 20rpx 40rpx;">
			<image style="width:34rpx;height:34rpx;margin: 14rpx 20rpx 0 20rpx;" src="/static/image/03_4dfb.png"></image>
			<input v-model="input" style="font-size: 28rpx;height:62rpx;width:510rpx;" placeholder="搜索城市"/>
			<view @click="sousuo" style="text-align: center; width: 104rpx;height: 64rpx;background: linear-gradient(180deg, #2089FF 0%, #11ACEF 100%);border-radius: 34rpx;line-height:64rpx;font-size: 26rpx;color: #FFFFFF;">搜索</view>
		</view>
		<ss-select-city v-model="value" :input-citys="inputs"  @on-select="City" />
	</view>
</template>

<script>
	import ssSelectCity from '@/components/ss-select-city/index.vue'
	export default {
		data() {
			return {
				input:'',
				inputs:'',
				// hotCitys: [],
				value: '济南'
			};
		},
		onLoad(option) {
			this.value = option.name
		},
		components: {
			ssSelectCity
		},
		methods: {
			sousuo(){
				this.inputs = this.input
			},
			City(city) {
				uni.request({
					header: {
						"Content-Type": "application/text"
					},
					url: 'https://restapi.amap.com/v3/config/district?parameters?'+city+'&subdistrict=2&key=b6a2663dc83e037455f2074be7ee0a48',
					success(rex) {
						if (rex.statusCode == 200) {
							console.log(rex,'---------------------')
						} else {}
					}
				});
				console.log(city)
			}
		}
	}
</script>

<style lang="scss">

</style>